package org.base.dao.modules.base;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import org.base.dao.common.Page;
import org.base.dao.common.Pair;


public interface BaseService<T> {
	
	
	/*----------------------------查询接口----------------------------*/
	Page<T> findPage(Page<T> page);
	
	List<T> findList(Map<String,Object> condition);
	
	T findById(Long id);
	
	List<T> findListByPairs(Pair... pairs);
	
	T findByPairs(Pair... pairs);
	//////////////////////////
	
	T getOne(T entity);
	
	T getOne(Map<String,Object> data);
	
	T getById(Long id);
	
	Integer getCount(Map<String,Object> data);
	
	List<Map<String,Object>> getMaps(Map<String,Object> data);
	
	List<T> getListByIds(Collection<Long> ids);
	
	List<T> getList(Map<String, Object> condition);
	
	List<T> getAll();
	
	
	/*----------------------------修改接口----------------------------*/
	boolean save(T entity);
	
	boolean save(Map<String,Object> data);
	
	boolean saveBatch(Collection<T> entitys);
	
	boolean saveBatchMap(Collection<Map<String,Object>> datas);
	
	
	/*----------------------------修改接口----------------------------*/
	boolean updateById(T entity);
	
	boolean updateById(Map<String,Object> data);
	
	boolean updateBatchById(Collection<T> entitys);
	
	boolean updateBatchMapById(Collection<Map<String, Object>> datas);
	
	
	/*----------------------------删除接口----------------------------*/
	boolean removeById(Long id);
	
	boolean removeByIds(Collection<Long> ids);
	
	boolean removeByMap(Map<String,Object> column);
	
	boolean remove(T entity);

}
